#Project Title: "Ladies’ Choice: Intersectional Linked Fate and Public Opinion Towards Women of Color in Politics"

#author: "Joyce H. Nguy"

# WoC Linked Fate Data Replication

## Description
This project utilizes the 2020 Collaborative Multiracial Post-Election Survey (CMPS) data to explore the relationship between intersectional linked fate amongst women of color (or, women of color linked fate) and public opinion towards women of color political figures. The file, `POQ WoC Linked Fate Data Replication.Rmd` includes variable creation, data cleaning, and data visualization, and statistical modeling to examine trends and relationships. It also analyzes data from the only other major survey other than the 2020 CMPS that has variables that align with our variables of interest at hand (women of color linked fate, and opinions about a woman of color politician) from the 1996 National Black Election Study (NBES).

## Files and Descriptions

### 1. `cmps.csv`
- **Description:** The dataset included in this replication contains a subsetted version of the 2020 CMPS dataset, which only hosts the variables we utilize in our analysis. 

### 2. `CMPS_WOCLF_Codebook`
- **Description:** This codebook contains the questions and response options from the 2020 CMPS of variables utilized in the study. 

### 3. `nbes.csv`
- **Description:** This dataset contains a subsetted version of the 1996 NBES data that is necessary for supplementary analysis. 

### 4. `NBES_WOCLF_Codebook`
- **Description:** This codebook contains the questions and response options from the 1996 NBES of variables utilized in the study. 

### 3. `POQ WoC Linked Fate Data Replication.Rmd`
- **Description:** This R Markdown file contains the code for cleaning the CMPS dataset, subsetting the CMPS data to focus on specific racial or ethnic groups or variables of interest, runs regression models, and creates outputs for the models. including the creation of new variables and the recoding of existing ones to prepare the data for analysis.

## Software Version
- **R Version:** All scripts and files in this project were created using R version 4.2.2.

## Instructions for Replication

1. **Set Up the Environment:**
   - Ensure you have R version 4.2.2 installed on your machine.
   - Install the necessary R packages by running the following command in R:
     ```r
     install.packages(c("haven", "tidyverse", "stargazer", "ggplot2", 
                        "RColorBrewer", "sjPlot", "scales", 
                        "questionr", "effects", "MASS", 
                        "corrplot", "psy", "psych", "REdaS"))
     ```

2. **Data Preparation:**
   - Run the `cleaning` chunks to clean the CMPS/NBES data and create the necessary variables.

3. **Subset Data:**
   - Run the `subset` chunks to subset the data by race and gender. 

4. **Run the Analysis:**
   - Run the `analysis` chunks to perform the statistical analysis and generate the output file.

## Contact
For any questions or issues, please contact Joyce Nguy at joycenguy@g.ucla.edu.
